package Array;

import java.util.*;

public class MultiArray{
  
  private void ff(){
    int[][] a = new int[2][3];
    for(int i=0;i<2;i++){
      for(int j=0;j<a[i].length;j++){
        a[i][j] = i+j;
      }
    }
    System.out.println(Arrays.toString(a[0]));
    
    int[][][] b = new int[1][1][1];
    System.out.println();
  }
  
  private int[] getSame(int intNum, int[] ia){
    int[] retu = new int[ia.length];
    retu[0] = -1;
    int num = 0;
    for(int i=0;i<ia.length;i++){
      if(intNum==ia[i]){
        retu[num] = i;
        num++;
      }
    }
    int[] r;
    if(num!=0){
      r = new int[num];
      r = Arrays.copyOf(retu, num);
      return r;
    }else{
      return retu;
    }
  }
  
  /*
  
  */
  private static int[] sort(int[] ia){
    for(int i=0;i<ia.length-1;i++){
      for(int j=i+1;j<ia.length;j++){
        if(ia[i]>ia[j]){
          int turn = ia[j];
          ia[j] = ia[i];
          ia[i] = turn;
        }
      }
    }
    return ia;
  }
  private int[][] sortMulti(int[][] ia){
    for(int i=0;i<ia.length;i++){
      ia[i] = MultiArray.sort(ia[i]);
    }
    return ia;
  }
  
  public static void main(String[] args){
    MultiArray ma = new MultiArray();
    int[] a = {6,2,6,9,6,4,6};
    //int[] b = ma.getSame(6,a);
   // if(b[0] == -1){
      //System.out.println("数组中没有匹配数字");
    //}else{
    //  System.out.println("数组中共有匹配的数字： "+b.length+"个；它们的下标分别为：");
     // for(int i=0;i<b.length;i++){
     //   System.out.print(b[i]+",");
     // }
    //}
    int[][] c = {{3,2,1},{0,2},{4,5,2,7,8,9,5,4}};
    int[][] d = ma.sortMulti(c);
    for(int i=0;i<d.length;i++){
      System.out.println(Arrays.toString(d[i]));
    }
    
  }
}
